Cevela about COBOL COBOL language - Home - Site Map - About Cevela - MX COBOL    <prev   next>
3.   Statements for program control flow
For more see links to the main provider's on-line documentation.
For MX COBOL see Summary comment + FAQ and How to ..

if

                                                                 60-1
body-of-statement*
   if  logical-expression-1*  imperative-statements-1*
                              next sentence
   [else  imperative-statements-2*]
          next sentence

end-of-statement* end-if 85-1 .


logical-expression-1* (condition-2* [and,or condition-3* ]) ... logical-exepression-2* logical-expression-3*

condition* / [not] Cond-1 / Dat-1 [not] numeric alphabetic / Dat-1 [not] {=,>,<,>=,<=} Dat-2


Remarks: - () parenthesis are recommended in greater expressions - there are other data-class names except numeric, alphabetic too
MX limitations: condition name must be in parenthesis = (Cond-1), (not Cond-1)

                                                                 60-2
sequence-of-statements*
   if  logical-expression-1*  imperative-statements-1*  else
                              next sentence
   ...
   [else  imperative-statements-2*]
          next sentence
end-of-sequence*
   .

MX limitations: when there are more (about 8 or 10) "if - else ..." in one sequence without full stop the last ones are not compiled correctly and in run-time the result of their condition-tests is ignored

perform

                                                                 60-1
/ perform  Proc-1

/ perform imperative-statements* . end-perform 85-1


Remark: for thru phrase see editor's remarks

                                                                 60-2
/ perform  Proc-1  Dat-2  times
                   Num-2

/ perform Dat-2 times Num-2

imperative-statements* . end-perform 85-2

                                                                 60-3
/ perform  Proc-1  [test after]  until  logical-expression*

/ perform [test after] until logical-expression*

imperative-statements* . end-perform 85-3

                                                                      60-4
/ perform  Proc-1  [test after]

varying Dat-2 from Dat-3 by Dat-4 until logical-expression* Ind-2 Ind-3 Int-4 Num-3

/ perform [test after]

varying Dat-2 from Dat-3 by Dat-4 until logical-expression* Ind-2 Ind-3 Int-4 Num-3

imperative-statements* . end-perform 85-4

                                                                      60-5
/ perform  Proc-1  [test after]

varying Dat-2 from Dat-3 by Dat-4 until logical-expression-5* Ind-2 Ind-3 Int-4 Num-3

after Dat-6 from Dat-7 by Dat-8 until logical-expression-9* Ind-6 Ind-7 Int-8 Num-7

...

/ perform [test after]

varying Dat-2 from Dat-3 by Dat-4 until logical-expression-5* Ind-2 Ind-3 Int-4 Num-3

after Dat-6 from Dat-7 by Dat-8 until logical-expression-9* Ind-6 Ind-7 Int-8 Num-7 ...

imperative-statements* . end-perform 85-5

evaluate

                                                                 85-1
evaluate  operand-1*  [also  operand-2*]  ...
   when  evaluation-1*  [also  evaluation-2*]  ...
      imperative-statements-1*
   ...
   [when other
      imperative-statements-o*]
end-of-statement*
   .
   end-evaluate

operand* Dat-1 Lit-1 arithm-expression-1* logical-expression-1* true false

evaluation* [not] Dat-2 [thru Dat-3 ] Lit-2 Lit-3 arithm-expression-2* arithm-expression-3* logical expression-2* any true false


MX limitations: this statement is not implemented

continue

                                                                 85-1
continue

MX limitations: statement is not implemented

stop run

                                                                 60-1
stop run

Remark: there are the others formats in COBOL-02 and provider's dialects

use

                                                                 68-1
use  [global]  after  error  files*
                             input
                             output
                             i-o
                             extend

files* File-1 ...


MX limitations: this statement is not functional

                                                                 68-2
use  [global]  before reporting  Rep-1

Remark: there are the others formats in COBOL-02 and provider's dialects MX limitations: this statement is not functional

resume

                                                                 02-1
resume  next statement
        Proc-1

Limitations: statement is not implemented in the others dialects inclusive MX

COBOL language in brief - © Vlastimil Cevela 2006

Date 2006-06-03 - Text Builder 0.65 - Time 20:31:27